{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
    <h3 class="pb-3">关于我们</h3>
    <table class="layui-table layui-table-form">
        <input type="hidden" value="{$id}" name="id">
        <tr>
            <td class="layui-td-gray">关于我们</td>
            <td>
				<textarea class="layui-textarea" id="container_contents">
					{notempty name="$config.about" }{$config.about}{/notempty}
				</textarea>
            </td>
        </tr>
    </table>

    <div class="py-3">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool','tinymce'];
    function gouguInit() {
        var form = layui.form, tool = layui.tool;
        var edits = layui.tinymce.render({
            selector: '#container_contents',
            height: 500
        });

        //监听提交
        form.on('submit(webform)', function (data) {
            data.field.about = tinyMCE.editors['container_contents'].getContent();
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    parent.layui.tool.close(1000);
                }
            }
            tool.post("/admin/conf/edit", data.field, callback);
            return false;
        });
    }
</script>
{/block}
<!-- /脚本 -->